﻿using System;
using System.Data.Entity;
using AdventureWorks.Entities;
using AdventureWorksData.DAO;

namespace AdventureWorksTests.Fakes
{
	public class FakeUnitOfWork : IUnitOfWork
	{
		private readonly DbContext _context;
		private IGenericRepository<Customer> _customer;
		private IGenericRepository<Address> _address;
		private IGenericRepository<Product> _product;
		private IGenericRepository<ProductModel> _productModels;
		private IGenericRepository<ProductCategory> _productCategories;

		public FakeUnitOfWork()
		{
			//_customer = new FakeCustomerRepository();
		}

		public IGenericRepository<Customer> Customers
		{
			get { return _customer ?? (_customer = new FakeGenericRepository<Customer>()); }
		}

		public IGenericRepository<Address> Addresses
		{
			get { return _address ?? (_address = new FakeGenericRepository<Address>()); }
		}

		public IGenericRepository<Product> Products
		{
			get { return _product ?? (_product = new FakeGenericRepository<Product>()); }
		}

		public IGenericRepository<ProductModel> ProductModels
		{
			get { return _productModels ?? (_productModels = new FakeGenericRepository<ProductModel>()); }
		}

		public IGenericRepository<ProductCategory> ProductCategories
		{
			get { return _productCategories ?? (_productCategories = new FakeGenericRepository<ProductCategory>()); }
		}

		public void Save()
		{
			
		}

		public void Dispose()
		{
			throw new NotImplementedException();
		}
	}
}
